import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/HomeView.vue'
Vue.use(VueRouter)

const routes = [
  {
    path:'/',
    redirect:'/home/index'
  },
  {
    path: '/home',
    name: 'Home',
    component: Home,
    children:
    [
        {
        path:'index',
        component:()=>import('../views/Index.vue'),
        meta:{  // 自定义原数据，绑定在路由对象上
          breadcrumb:['后台管理','首页']
        }
        },
        {
          path:'actor-add',
          component:()=>import('../views/actor/ActorAdd.vue'),
         meta:{ 
          breadcrumb:['演员管理','新增演员']
        }
        },
        {
          path:'actor-list',
          component:()=>import('../views/actor/ActorList.vue'),
         meta:{ 
          breadcrumb:['演员管理','演员列表']
        }
        },
        {
          path:'director-add',
          component:()=>import('../views/director/DirectorAdd.vue'),
         meta:{ 
          breadcrumb:['导演管理','新增导演']
        }
        },
        {
          path:'director-list',
          component:()=>import('../views/director/DirectorList.vue'),
         meta:{ 
          breadcrumb:['导演管理','导演列表']
        }
        },
        {
          path: 'movie-list',
          component:()=>import('../views/movie/MovieList.vue'),
         meta:{ 
          breadcrumb:['电影管理','电影列表']
        }
        },
        {
          path: 'movie-add',
          component:()=>import('../views/movie/MovieAdd.vue'),
         meta:{ 
          breadcrumb:['电影管理','新增电影']
             }
        },
        {
          path: 'movie-update/:id',
          component:()=>import('../views/movie/MovieUpdate.vue'),
           meta:{ 
          breadcrumb:['电影管理',{text:'电影列表',to:'/home/movie-list'},'修改电影信息']
            },
        },
        {
          path: 'cinema-list',
          component:()=>import('../views/cinema/CinemaList.vue'),
           meta:{ 
            breadcrumb:['电影管理',{text:'电影院列表',to:'/home/cinema-list'}]
          },
        },
        {
          path: 'cinema-add',
          component:()=>import('../views/cinema/CinemaAdd.vue'),
         meta:{ 
          breadcrumb:['电影管理',{text:'添加电影院',to:'/home/cinema-list'}]
        },
      },
        {
          path: 'cinema-update/:id',
          component:()=>import('../views/cinema/CinemaUpdate.vue'),
          meta:{ 
          breadcrumb:['电影管理',{text:'电影院列表',to:'/home/cinema-list'},'修改影院信息']
        },
        },
        {
          path: 'cinema-room/:id',
          component:()=>import('../views/cinema/CinemaRoom.vue'),
          meta:{ 
          breadcrumb:['电影管理',{text:'电影院列表',to:'/home/cinema-list'},'电影放映厅列表']
        },
        }
        
    ]
  },
  // {
  //   path: '/about',
  //   name: 'About',
  //   component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  // }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
